<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Home</title>
		<!--bootstarp-css-->
		<link href="../css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
		<!--/bootstarp-css -->
		<!--css-->
		<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
		<link href="../css/hover.css" rel="stylesheet" media="all">
		<!--/css-->
		<script type="application/x-javascript">
			addEventListener("load", function() {
				setTimeout(hideURLbar, 0);
			}, false);

			function hideURLbar() {
				window.scrollTo(0, 1);
			}
		</script>

		<script src="../js/jquery.min.js"></script>
		<script src="../js/modernizr.custom.js"></script>
		<script src="../js/responsiveslides.min.js"></script>
		<script>			
			$(function() {
				$("#slider2").responsiveSlides({
					auto: true,
					pager: true,
					speed: 300,
					namespace: "callbacks",
				});
			});
		</script>
		<style>
			#yincan {
				width: 160px;
				height: 110px;
				position: absolute;
				top: 70px;
				right: 46px;
				background-color: #fff;
				display: none;
			}
		</style>
	</head>
	<body>
		<!--header-->
		<div class="header">
			<ul class="login">
				<li><a href="login.html">登录</a></li>
				<li><a>|</a></li>
				<li><a href="login.html">注册</a></li>

			</ul>
			<div class="header-info">
				<div class="container">
					<div class="logo">
						<a href="index.html"><img src="../images/logo-pet.png" style="position: absolute;width: 330px;height: 262px;top: -60px;left: 280px;"/><!-- <img src="../images/logo.png" alt="" /> --></a>
					</div>
					<div class="search-box">
						<form>
							<input type="text" name="s" class="textbox" placeholder="Search" required="">
							<input type="submit" value="">
						</form>
					</div>
					<div class="clearfix"> </div>
				</div>
			</div>
		</div>
		<div class="container">
			<div class="header-bottom">
				<div class="menu">
					<span class="menu-info"> </span>
					<ul class="cl-effect-21">
						<li id='oneser'><a id="service" class="active">服务中心</a>
							<div id="yican">
								<div>
									<p><a id="adopt" >宠物领养</a></p>
									<p><a id="farmed">宠物寄养</a></p>
									<p><a id="notice">寻宠|招领</a></p>
								</div>
							</div>
						</li>
						<li><a id="petbaike">宠物百科</a></li>
						<li><a id="news">宠物新闻</a></li>
						<li><a id="bbs">宠物论坛</a></li>
						<li><a id="404">关于我们</a></li>
						<li id="twoser">
							<a id="myme">个人中心</a>
							<div id="yincan">
								<div>
									<p><a id="myinfos">我的</a></p>
									<p><a id="overpet">注销</a></p>
								</div>
							</div>
						</li>
					</ul>
				</div>

				<div class="clearfix"> </div>
			</div>
		</div>
		<div class="header-banner">
			<div class="slider">
				<ul class="rslides" id="slider2">
					<li><a href="#"><img src="../images/4.jpg" class="img-responsive" alt="" /></a></li>
					<li><a href="#"><img src="../images/2.jpg" class="img-responsive" alt="" /></a></li>
					<li><a href="#"><img src="../images/3.jpg" class="img-responsive" alt="" /></a></li>
				</ul>
			</div>
		</div>
		<!--/header-->

		<!--footer-->
		<div class="footer">
			<div class="container">
				<div class="copy-rights">
					<p>Copyright &copy; 2023.Company <a target="_blank" href="index.html">you宠</a></p>
				</div>

			</div>
		</div>
		<!--yican -->
		<script>
			$("#service").mouseenter(function() {
				$("#yican").css("display", "block");
			});
			$("#oneser").mouseleave(function() {
				$("#yican").css("display", "none");
			});
			$("#myme").mouseenter(function() {
				$("#yincan").css("display", "block");
			});
			$("#twoser").mouseleave(function() {
				$("#yincan").css("display", "none");
			});
		</script>
		<!-- /yican -->
		<!--/footer-->
		<script type="text/javascript">

			$(function(){
				// let temp = new URLSearchParams(location.search);
				// let yh = temp.get("yh");
				//用户登录即 拥有功能
				$.post('http://localhost:80/ct/yzlogin',function(res){
				 	if(res){
				 		$(".login").css("display","none");
						$("#adopt").attr("href","adopt.html");
						$("#farmed").attr("href","farmed.html");
						$("#notice").attr("href","notice.html");
						$("#myinfos").attr("href","myinfo.html");
						$("#petbaike").attr("href","petbaike.html");
						$("#news").attr("href","news.html");
						$("#bbs").attr("href","bbs.html");
						// $("#404").attr("href","404.html");
				 	}
				 });			
				$(".menu li").click(function(){
					yzlogin();
				})
				//注销
				$("#overpet").click(function(){
					if(!confirm('是否确定注销该用户并退出登录？'))
					return;
					$.post('http://localhost:80/ct/remove',function(res){
						if(res){
							location.href='login.html';
						}
					});
				})
				
			})
			//验证登录
			function yzlogin(){
				let temp = new URLSearchParams(location.search);
				let yh = temp.get("yh");	
				
				$.post('http://localhost:80/ct/yzlogin',function(res){
					if(res){
						$(".login").css("display","none");
					}else{
						if(!confirm("未查询到用户登录，是否前往登录？"))
						return;
						location.href='login.html';
					}
				});
			}						
		</script>
		
		
	</body>
</html>